<template>
  <div class="app-container">
    <analyze></analyze>
    <el-tabs v-model="staffActiveName" type="border-card">
      <el-tab-pane label="待入职" name="0">
        <staff-sray v-if="staffActiveName == 0"></staff-sray>
      </el-tab-pane>
      <el-tab-pane label="已入职" name="1">
        <staff-already-employed v-if="staffActiveName == 1"></staff-already-employed>
      </el-tab-pane>
      <el-tab-pane label="已在岗" name="2">
        <staff-already-job v-if="staffActiveName == 2"></staff-already-job>
      </el-tab-pane>
      <el-tab-pane label="已挂岗" name="3">
        <staff-un-preparation v-if="staffActiveName == 3"></staff-un-preparation>
      </el-tab-pane>
      <el-tab-pane label="已离职" name="4">
        <staff-resigned v-if="staffActiveName == 4"></staff-resigned>
      </el-tab-pane>
      <el-tab-pane label="黑名单" name="5">
        <staff-blacklist v-if="staffActiveName == 5"></staff-blacklist>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import staffSray from "./staffSray.vue";
import staffAlreadyEmployed from "./staffAlreadyEmployed.vue";
import staffAlreadyJob from "./staffAlreadyJob.vue";
import staffResigned from "./staffResigned.vue";
import staffBlacklist from "./staffBlacklist.vue";
import staffUnPreparation from "./staffUnPreparation.vue";
import analyze from './analyze.vue';

export default {
  name: "Staff",
  components: {
    staffSray,
    staffAlreadyEmployed,
    staffAlreadyJob,
    staffResigned,
    staffBlacklist,
    staffUnPreparation,
    analyze
  },
  data() {
    return {
      // tab切换值
      staffActiveName: '0',
    };
  },
  provide() {
    return {
      formatGender: this.formatGender
    }
  },
  created() {
  },
  methods: {
    formatGender(value) {
      if (value) {
        if ([0, 1].includes(Number(value))) {
          return value == 0 ? '男' : '女'
        }
        return value
      }
      return value
    }
  }
};
</script>
